package br.com.locale;

import java.util.Calendar;
import java.util.Locale;

public class CalendarTeste {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// Create a calendar that is set to 31. December 2008:
		Calendar dataHoraAtual = Calendar.getInstance(new Locale("en","US"));
		
		System.out.println(dataHoraAtual.getTime());
		
		Calendar calendar = Calendar.getInstance();
		calendar.set(Calendar.DAY_OF_MONTH, 31);
		calendar.set(Calendar.MONTH, Calendar.DECEMBER);
		calendar.set(Calendar.YEAR, 2008);
		calendar.set(Calendar.SECOND, 0);
		
		calendar.set(Calendar.MINUTE, 0);
		calendar.set(Calendar.HOUR_OF_DAY, 0);
		
		
//		calendar.set(Calendar.DAY_OF_MONTH, 1);
//		 calendar.set(Calendar.MONTH, Calendar.JANUARY);
//		 calendar.set(Calendar.YEAR, 2009);
//		 calendar.set(Calendar.DAY_OF_MONTH, 1);
//		 calendar.set(Calendar.MONTH, 12);
//		 calendar.add(Calendar.DAY_OF_MONTH, 1);
		 calendar.roll(Calendar.DAY_OF_MONTH, 1);
//		 calendar.set(2009, 0, 1);
		 calendar.set(2009, 1, 1);
		
		System.out.println(calendar.getTime());

	}

}
